package com.ludomancy.timescape;

import java.awt.Graphics;

public class WaterEntity extends Entity
{
	private static final int MAX_TURNS = 6;
	private int activeTurns;
	
	public WaterEntity(int initialTime, int x, int y)
	{
		super(initialTime, x, y);
	}

	public void affectEnvironment()
	{
		if(activeTurns > 0)
		{
			Game.game.currentTerrain.addWater(tx, ty);
		}
	}

	public void evolve()
	{
		activeTurns--;
	}

	public void paint(Graphics g)
	{
//		if(initialTime == Game.game.currentTime)
		{
			sprites.paint(g, SPRITE_WATER, tx * Game.TILE_SIZE, ty * Game.TILE_SIZE);
		}
	}

	public void reset()
	{
		activeTurns = MAX_TURNS;
	}

}
